Skip to content

Add tests for ThrowableFunction and FileExtensionFilter to approach 100% coverage#257

Merged
mercyblitz merged 6 commits intodevfrom
copilot/add-test-cases-for-coverage
Mar 19, 2026
Merged

Add tests for ThrowableFunction and FileExtensionFilter to approach 100% coverage#257
mercyblitz merged 6 commits intodevfrom
copilot/add-test-cases-for-coverage

Conversation

Copy link
Contributor

Copilot AI commented Mar 19, 2026

This pull request adds a comprehensive set of new unit tests across several core modules, focusing on improving coverage for collections, conversion, file I/O, and JSON handling. The new tests verify immutability, edge cases, error handling, and correct fallback behaviors, as well as introduce a new test class for the StringToIterableConverter. These changes help ensure the robustness and reliability of the library's core utilities.

Collections:

  • Added tests to verify immutability of ofList, ofSet, and ofMap methods in ListsTest, SetsTest, and MapsTest, ensuring that attempts to modify returned collections throw UnsupportedOperationException. [1] [2] [3]
  • Added tests for additional behaviors in AbstractDequeTest, including removeFirstOccurrence, offer/poll sequences, and push/pop operations.

Conversion:

  • Introduced a new test class StringToIterableConverterTest that covers acceptance, conversion, fallback, and priority logic for StringToIterableConverter and StringToCollectionConverter.
  • Enhanced AbstractConverterTest with tests for hashCode, resolvePriority, and additional equality scenarios.

File I/O and Filtering:

  • Added tests for StandardFileWatchService to cover starting, stopping, closing, and handling multiple listeners.
  • Expanded FileExtensionFilterTest with cases for dot-prefixed extensions and filename filter acceptance.

JSON Handling:

  • Added tests to JSONArrayTest and JSONObjectTest for invalid double values, fallback behaviors for optBoolean, optDouble, optInt, optLong, and optString, as well as write operations and exception handling. [1] [2]

Classloading:

  • Improved AbstractURLClassPathHandleTest with a test for setting and restoring priority.

…nsionFilter

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Java test cases for ThrowableFunction and FileExtensionFilter Add tests for ThrowableFunction and FileExtensionFilter to approach 100% coverage Mar 19, 2026
Copilot AI requested a review from mercyblitz March 19, 2026 04:19
@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…dFileWatchService, and ArtifactDetector

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…ue, StringToIterableConverter, and AbstractURLClassPathHandle

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…ionUtils

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
@sonarqubecloud
Copy link

@mercyblitz mercyblitz marked this pull request as ready for review March 19, 2026 07:13
Copilot stopped work on behalf of mercyblitz due to an error March 19, 2026 07:33
Copilot stopped work on behalf of mercyblitz due to an error March 19, 2026 07:37
@mercyblitz mercyblitz merged commit 655eb32 into dev Mar 19, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants